package obj_.Datedemo.DateFormat;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class demo01 {
    public static void main(String[] args) throws ParseException {
        method1();
    }

    private static void method1() throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat();
        Date parse = sdf.parse("2020/11/29 下午10:18");
        System.out.println(parse);

    }

    private static void method() {
        //格式化输出时间
        //Sun Nov 29 22:18:22 CST 2020 =》
        //2020/11/29 下午10:18
        SimpleDateFormat sdf =new SimpleDateFormat();
        Date date = new Date();
        String format = sdf.format(date);
        System.out.println(date);
        System.out.println(format);

    }
}
